# coding = utf-8

'''
获取肝脏肿瘤
'''

import os
import SimpleITK as sitk
import matplotlib.pyplot as plt

def read_data():
    data_path = "/datasets/qiye/image_arterial"
    file_list = sorted(os.listdir(data_path))
    file_name = file_list[35]
    print(file_name)
    file_name = os.path.join(data_path, file_name)
    data = sitk.GetArrayFromImage(sitk.ReadImage(file_name))
    t = data[648]
    t [t<= -250] = -250
    t[t>=200] = 200
    plt.imshow(t, cmap="gray")
    plt.show()




if __name__ == '__main__':
    read_data()